package edu.sctu.wujiayi.month05.day20150527;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by user11 on 2015/5/27.
 */
public class ChooseDish {

    public List<String> dish1(){
        List<String> dish1 = new ArrayList<>();
        dish1.add(1,"鱼香肉丝");
        dish1.add(2,"青椒肉丝");
        dish1.add(3,"京酱肉丝");
        dish1.add(4,"木耳肉片");
        dish1.add(5,"水煮肉片");
        dish1.add(6,"铁板牛柳");
        dish1.add(7,"土豆烧肉");
        dish1.add(8,"麻婆豆腐");
        dish1.add(9,"青椒土豆");
        return dish1;
    }

    public List<String> dish2(){
        List<String> dish2 = new ArrayList<>();
        dish2.add(1,"肝腰合炒");
        dish2.add(2,"夫妻肺片");
        dish2.add(3,"香菇炖鸡");
        dish2.add(4,"海带排骨");
        dish2.add(5,"干锅烧鸡");
        dish2.add(6,"糖醋排骨");
        dish2.add(7,"滑肉菜汤");
        dish2.add(8,"九九寿饺");
        dish2.add(9,"凉拌黄瓜");
        return dish2;
    }
    public String chooseDish1(){
        Scanner di = new Scanner(System.in);
        String dish = null;
        System.out.println("选择菜品:");
        dish = di.nextLine();
        for (int i = 0;i<dish1().size();i++) {
            if (dish.equals(dish1().get(i))) {
                System.out.println("菜品为："+dish1().get(i)+" "+"价格为："+i);
            }
            return dish1().get(i);

        }
        return dish;
    }

    public String chooseDish2(){
        Scanner di = new Scanner(System.in);
        String dishs = null;
        System.out.println("选择菜品:");
        dishs = di.nextLine();
        for (int i = 0;i<dish2().size();i++) {
            if (dishs.equals(dish2().get(i))) {
                System.out.println("菜品为："+dish2().get(i)+" "+"价格为："+i);
            }
            return dish2().get(i);

        }
        return dishs;
    }

}
